import Request from '@/libs/request'

/**查询所有的管理员类型以及人员 */
export const selectPmRoleType = (data: {userDDId: string}) =>
  Request.get<User.ManagerTableData[]>('/pmRole/selectPmRoleType', data)

/**添加管理员 */
export const addPmManager = (data: {userDDId: string}) =>
  Request.get<null>('/pmRole/addPmManager', data)

/**删除管理员 */
export const deletePmManager = (data: {userDDId: string}) =>
  Request.get<null>('/pmRole/deletePmManager', data)

/**查询绩效等级 */
export const selectAllPmLevel = () =>
  Request.get<
    {
      pmLevelHighValue: number
      pmLevelLowValue: number
      pmLevelName: 'A' | 'B' | 'C' | 'D'
      sort: number
    }[]
  >('/pmLevel/selectAllPmLevel')

/**修改绩效等级 */
export const editPmLevel = (
  data: {
    pmLevelHighValue: number
    pmLevelLowValue: number
    pmLevelName: 'A' | 'B' | 'C' | 'D' | 'S'
    sort: number
  }[]
) => Request.post<null>('/pmLevel/editPmLevel', data)

/**同步通讯录 */
export const ddSyncAddressBook = (data: {userDDId: string}) =>
  Request.get<null>('/dd/ddSyncAddressBook', data)

/**转交绩效 */
export const anonymousPmProgress = (data: {
  /**登陆者Id */
  userDDId: string
  /**被转交者Id */
  anonymousUserDDId: string
  /** 当前绩效流程Id*/
  nowPmProgressId: number
}) => Request.get<null>('/pmProgress/anonymousPmProgress', data)
